package com.qlshouyu.len41.config;

import com.qlshouyu.len41.filter.AppFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * TODO
 *
 * @author 高露 邮箱：<a href="egojit@qq.com">egojit@qq.com</a>
 * @since 2019-10-27 08:13
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean testFilterRegistrationBean(){
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new AppFilter());
        List<String> a = new ArrayList<>();
        a.add("/*");
        registrationBean.setUrlPatterns(a);
        registrationBean.setName("AppFilter");
        return registrationBean;
    }
}
